class dreamWeight():
    def __init__(self):
        pass

    def calc(self, data):
        """
        计算理想体重
        """
        sex = data['sex']
        weight = int(data['weight'])
        height_ = int(data['height'])
        height = height_ * 3.28084 / 100
        if sex == '男':
            data1 = round(int(height / 5) * 52 + (height % 5) * 12 * 1.9)
            data2 = round(int(height / 5) * 56.2 + (height % 5) * 12 * 1.41)
            data3 = round(int(height / 5) * 48 + (height % 5) * 12 * 2.7)
            data4 = round(50 + (height * 12 - 60) * 2.3)
        else:
            data1 = round(int(height / 5) * 52 + (height % 5) * 12 * 1.7)
            data2 = round(int(height / 5) * 56.2 + (height % 5) * 12 * 1.36)
            data3 = round(int(height / 5) * 48 + (height % 5) * 12 * 2.2)
            data4 = round(45.5 + (height * 12 - 60) * 2.3)
        bmi = round(weight / pow(height_ / 100, 2), 2)
        if bmi >= 30:
            bmi_type = '  您属于肥胖'
        elif 25 <= bmi < 30:
            bmi_type = '  您属于超重'
        elif 18.5 <= bmi < 25:
            bmi_type = '  您属于正常重量'
        else:
            bmi_type = '  您属于体重过轻'
        return {"dram": "  理想体重：" + str(min(data1, data2, data3, data4)) + "-" + str(max(data1, data2, data3, data4)),
                "bmi": "  bmi值：" + str(bmi),
                "bmi_type": bmi_type}


if __name__ == '__main__':
    print(dreamWeight().calc({"weight": "75", "age": "26", "height": "160", "sex": "男"}))